<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="Author" contect="http://www.webqin.net">
    <title>忘记密码</title>
    <link rel="shortcut icon" href="images/favicon.ico"/>
    <link type="text/css" href="css/css.css" rel="stylesheet"/>
</head>

<body>

<div class="content">
    <div class="web-width">
        <div class="for-liucheng">
            <div class="liulist for-cur"></div>
            <div class="liulist"></div>
            <div class="liulist"></div>
            <div class="liulist"></div>
            <div class="liutextbox">
                <div class="liutext for-cur"><em>1</em><br/><strong>填写账户名</strong></div>
                <div class="liutext"><em>2</em><br/><strong>验证身份</strong></div>
                <div class="liutext"><em>3</em><br/><strong>设置新密码</strong></div>
                <div class="liutext"><em>4</em><br/><strong>完成</strong></div>
            </div>
        </div><!--for-liucheng/-->
        <form action="" method="get" class="forget-pwd">
            <dl>
                <dt>账户名：</dt>
                <dd><input type="text" class="account"/></dd>
                <div class="clears"></div>
            </dl>
            <dl>
                <dt>验证码：</dt>
                <dd>
                    <input type="text"/>
                    <div class="yanzma">
                        <img src="yzm.gif"/> <a href="javascript:;">换一换</a>
                    </div>
                </dd>
                <div class="clears"></div>
            </dl>
            <div class="subtijiao"><input type="submit" onclick="sendEmail()" value="提交"/></div>
        </form><!--forget-pwd/-->
    </div><!--web-width/-->
</div><!--content/-->
</body>
<script type="text/javascript" src="../home/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../home/js/config.js"></script>
<script>

    // forgetPwd2.html
   
    function sendEmail() {

        $.ajax({

            url: "http://127.0.0.1:8080/account/sendEmail",
            type: 'GET',
            data: {
                account: $('.account').val()
            },
            dataType: 'JSON',
            async: false,
            success: function (res) {

                if (res.code == '0200') {
                    sessionStorage.setItem("userAccount", $('.account').val());
                    sessionStorage.setItem("userEmail", res.data);
					$('.forget-pwd').attr("action","forgetPwd2.html");
                    $('.forget-pwd').submit();
                } else {
				    alert('验证码发送失败,错误:' + res.msg);
				    $('.forget-pwd').attr("action",""); 
                    
                }
            }
        })
		return false;
    }

</script>
</html>
